package com.dy.nygl.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.nygl.mapper.RoomMapper;
import com.dy.nygl.pojo.Room;
import com.dy.nygl.service.RoomService;

@Service("roomService")
public class RoomServiceImpl implements RoomService{

	@Resource(name="roomDAO")
	private RoomMapper roomDAO;
	
	public List<Room> getRoom(int buildingId) {
		List<Room> list = roomDAO.getRoom(buildingId);
		if(list.size()>0) {
			return list;
		}
		return null;
	}
	
	public Room getRoomById(int id) {
		Room room = roomDAO.getRoomById(id);
		if(room != null) {
			return room;
		}
		return null;
	}

}
